package com.sysu.codeDetect.model.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 代码优化记录表
 * @TableName optimize_record
 */
@TableName(value ="optimize_record")
@Data
public class OptimizeRecord implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户账号，外键，引用自user表
     */
    private String userAccount;

    /**
     * 原始代码文件的文件名
     */
    private String originalCodeFileName;

    /**
     * 用户原始上传的文件的 URL
     */
    private String originalCodeFileUrl;

    /**
     * 优化后的代码文件的 URL
     */
    private String optimizedCodeFileUrl;

    /**
     * 代码优化报告的 URL
     */
    private String reportUrl;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OptimizeRecord other = (OptimizeRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserAccount() == null ? other.getUserAccount() == null : this.getUserAccount().equals(other.getUserAccount()))
            && (this.getOriginalCodeFileName() == null ? other.getOriginalCodeFileName() == null : this.getOriginalCodeFileName().equals(other.getOriginalCodeFileName()))
            && (this.getOriginalCodeFileUrl() == null ? other.getOriginalCodeFileUrl() == null : this.getOriginalCodeFileUrl().equals(other.getOriginalCodeFileUrl()))
            && (this.getOptimizedCodeFileUrl() == null ? other.getOptimizedCodeFileUrl() == null : this.getOptimizedCodeFileUrl().equals(other.getOptimizedCodeFileUrl()))
            && (this.getReportUrl() == null ? other.getReportUrl() == null : this.getReportUrl().equals(other.getReportUrl()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserAccount() == null) ? 0 : getUserAccount().hashCode());
        result = prime * result + ((getOriginalCodeFileName() == null) ? 0 : getOriginalCodeFileName().hashCode());
        result = prime * result + ((getOriginalCodeFileUrl() == null) ? 0 : getOriginalCodeFileUrl().hashCode());
        result = prime * result + ((getOptimizedCodeFileUrl() == null) ? 0 : getOptimizedCodeFileUrl().hashCode());
        result = prime * result + ((getReportUrl() == null) ? 0 : getReportUrl().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userAccount=").append(userAccount);
        sb.append(", originalCodeFileName=").append(originalCodeFileName);
        sb.append(", originalCodeFileUrl=").append(originalCodeFileUrl);
        sb.append(", optimizedCodeFileUrl=").append(optimizedCodeFileUrl);
        sb.append(", reportUrl=").append(reportUrl);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}